//part1:C03:ex3.3.cpp -- one instance of string.
#include <iostream>
#include <string>

int main(void)
{
    using namespace std;
    string word, line;
    cout << "Enter some characters: 1.read words, 2.read line." << endl;
    char ch;
    cin >> ch;

    if (ch == '1')
    {
        cout << "Enter characters : Welcome to C++ family! " << endl;
        cin >> word;
        cout << "You had entered words :" << endl;
        cout << word << endl;
        return 0;
    }

    cin.clear();
    cin.sync();
    if (ch == '2')
    {
        cout << "Enter some characters : Welcome to C++ family! " << endl;
        getline(cin, line);
        cout << "you had entered charcters :\n";
        cout << line << endl;
        return 0;
    }
    cout << "You entered error!\n";

    return 0;
}
